package com.base.cn.platform.os.service.manage.op.giftcard;


import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.Map;

/**
 * 礼品卡接口
 */
@FeignClient(name = BaseService.appName , configuration = FeignAuthConfig.class)
public interface OpGiftCardService extends BaseService {


    /**
     * 搜索礼品卡列表
     * @param giftCard
     * @return
     */
    @RequestMapping(contextPath + "/op/queryGiftCardListPage")
    Map<String,Object> queryGiftCardListPage(@RequestParam("currentPage") Integer currentPage,
                                             @RequestBody Map<String, Object> giftCard,
                                             @RequestParam("courseData") boolean courseData);

    /**
     * 添加礼品卡
     * @param giftCard
     * @return
     */
    @RequestMapping(contextPath + "/op/saveGiftCard")
    Map<String,Object> saveGiftCard(@RequestBody Map<String, Object> giftCard);


    /**
     * 批量删除 ， 冻结 ， 恢复 ，发布
     * @param giftCardIds
     * @param status
     * @return
     */
    @RequestMapping(contextPath + "/op/updateStatusByIds")
    Map<String,Object>  updateStatusByIds(@RequestParam("giftCardIds") String giftCardIds,
                                          @RequestParam("status") Integer status);

    /**
     * 查看详情页面
     * @param giftCardId 礼品卡Id
     * @return
     */
    @RequestMapping(contextPath + "/op/queryOpGiftCardById")
    Map<String,Object> queryOpGiftCardById(@RequestParam("giftCardId") BigDecimal giftCardId,
                                           @RequestParam("courseData") boolean courseData);


    /**
     * 赠送GiftCard礼品卡
     * @param userIds
     * @return
     */
    @RequestMapping(contextPath + "/op/presentGiftCard")
    Map<String,Object> presentGiftCard(@RequestParam("userIds") String userIds,
                                       @RequestParam("giftCardId") BigDecimal giftCardId);

    /**
     * 礼品卡导出
     * @param giftCardId
     * @param useType
     * @return
     * @throws IOException
     */
    @RequestMapping(contextPath + "/op/downloadExcelGiftCardList")
    ResponseEntity<byte[]> downloadExcelGiftCardList(@RequestParam(value = "giftCardId") BigDecimal giftCardId, @RequestParam(value = "useType", required = false) Integer useType) throws IOException;
}
